package com.china.school.controller;

import com.china.school.User;
import com.china.school.editor.MyDatePropertyEditor;
import org.springframework.ui.Model;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

@RestController
public class PropertyEditorController {

    /**
     注册PropertyEditor
     */
    @InitBinder
    public void initBinder(WebDataBinder webDataBinder){
        webDataBinder.registerCustomEditor(Date.class,new MyDatePropertyEditor());
    }

}
